/**
* Created by wust on 2020-07-15 14:16:53.
*/
<template>
	<div>
		<el-button-group style="margin-bottom: 5px;">
			<el-button size="mini" type="primary" v-file-download-directive="'detail_template.xls'">下载模版</el-button>
		</el-button-group>
		<el-form label-width="120px" @submit.native.prevent>
			<file-upload-component :src="uploadUrl" :fileType="'xls,xlsx'" :fileSize="10" :fileNumber="1" v-on:importCallback="importCallback"></file-upload-component>
		</el-form>
	</div>
</template>
<script>
import Vue from 'vue'
import FileUploadComponent from '@/common/component/file-upload-component.vue'
export default {
  name: 'detail-import',
  components: {
    FileUploadComponent
  },
  data () {
    return {
      uploadUrl: Vue.$orderServerURL + '/web/v1/DetailController/importByExcel?xmlName=order_server_detail'
    }
  },
  methods: {
    importCallback: function (e) { // 回调
      this.$confirm('导入完成，需要跳转到结果页面吗？', '询问', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$router.push({
          path: '/MyImportExportList'
        })
      }).catch(() => {})
    }
  }
}
</script>
